package com.spring1.factory;

import java.util.HashMap;
import java.util.Map;

public class BeanFactory {
    Map<String, Object> map = new HashMap<>();

    public Object getBean(String key) {
        return map.get(key);
    }

    public <T> T getBean(String key, Class<T> tClass) {
        return (T) map.get(key);
    }

    public void setBean(String name, Object object) {
        map.put(name, object);
    }
}
